﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Sitemaps.ascx.cs" Inherits="VLUNewsUI.VLUSitemap.Sitemaps" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %>

<div class="dnnActions dnnClear">
    <asp:DataList ID="dtlParent" runat="server" RepeatDirection="Horizontal" 
        ShowFooter="False" ShowHeader="False">
        <ItemTemplate>
            <dnn:CommandButton Text='<%# Eval("Value") %>' CommandArgument='<%# Eval("Key") %>' DisplayIcon="false" ID="cmdParent" runat="server" />
        </ItemTemplate>
    </asp:DataList>
</div>

<div style="display:none">
    <asp:Label ID="lblParentID" runat="server" Text="0"></asp:Label>
</div>

<div class="dnnForm dnnSecurityRoles">
	<asp:datagrid id="dgdSitemap" Width="98%" AutoGenerateColumns="False" 
        runat="server" BorderStyle="None" GridLines="None" CssClass="dnnGrid">
        <headerstyle cssclass="dnnGridHeader" verticalalign="Top"/>
	    <itemstyle cssclass="dnnGridItem" horizontalalign="Left"/>
	    <alternatingitemstyle cssclass="dnnGridAltItem" />
	    <edititemstyle cssclass="dnnFormInput" />
	    <selecteditemstyle cssclass="dnnFormError" />
	    <footerstyle cssclass="dnnGridFooter" />
	    <pagerstyle cssclass="dnnGridPager" />
		<columns>
			<dnn:imagecommandcolumn commandname="Edit" IconKey="Edit" EditMode="URL" keyfield="SitemapID" />
			<%--<dnn:imagecommandcolumn commandname="Up" IconKey="Up" keyfield="SitemapID" Visible="false"/>--%>
			<%--<dnn:imagecommandcolumn commandname="Down" IconKey="Down" keyfield="SitemapID" Visible="false"/>--%>
			<dnn:imagecommandcolumn commandname="Select" IconKey="Select" keyfield="SitemapID" />
		    <asp:boundcolumn DataField="SitemapID" HeaderText="SitemapID" Visible="false"/>
		    <asp:boundcolumn DataField="SitemapName" HeaderText="SitemapName" />
            <%--IsSecurity--%>
			<asp:TemplateColumn>
            <HeaderTemplate>
                <dnn:Label ID="colIsSecurity" runat="server" ResourceKey="IsSecurity"/>
            </HeaderTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="chbIsSecurity" runat="server" Checked='<%# Eval("IsSecurity") %>' Enabled="false"/>
            </ItemTemplate>
            </asp:TemplateColumn>
		    <%--<asp:boundcolumn DataField="IsSecurity" HeaderText="IsSecurity" />--%>
		</columns>
	</asp:datagrid>
</div>

<script language="javascript" type="text/javascript">
    /*globals jQuery, window, Sys */
    (function ($, Sys) {
        $(document).ready(function () {
            var parentId = $("#<%= lblParentID.ClientID%>").text();
            var first = $(".dnnActionMenuBody li:first-child a:first-child");
            var url = first.attr('href');
            url = url.replace("ParentID/-1", "ParentID/" + parentId);
            first.attr('href', url);
        });
    } (jQuery, window.Sys));
</script>